<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">

<head>

    <title>删除光标所在行</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

</head>

<body>
<!-- ***************************PageOffice组件客户端Js代码******************************** -->
<script type="text/javascript">
    //删除word表格中光标所在行
    //        function DeleteRow() {
    //            var appObj = document.getElementById("PageOfficeCtrl1").Document.Application;

    //            appObj.Selection.HomeKey(10);
    //            appObj.Selection.EndKey(10, true);
    //            appObj.Selection.Cells.Delete(2);
    //            appObj.Selection.TypeBackspace();
    //        }
    //删除word表格中光标所在行，各种浏览器下均可使用
    function DeleteRow() {
        var mac = "Function myfunc()" + " \r\n"
            + "Application.Selection.HomeKey Unit:=wdLine " + " \r\n"
            + "Application.Selection.EndKey Unit:=wdLine, Extend:=true " + " \r\n"
            + "Application.Selection.Cells.Delete ShiftCells:=wdDeleteCellsEntireRow " + " \r\n"
            + "Application.Selection.TypeBackspace " + " \r\n"
            + "End Function " + " \r\n";
        document.getElementById("PageOfficeCtrl1").RunMacro("myfunc", mac);
    }
</script>
“删除行”按钮可以删除光标所在行
<div style="width:auto; height:700px; " th:utext="${pageoffice}">
</div>

</body>

</html>
